module.exports = (app) => {
  const { router, controller, middleware } = app;
  const subRouter = router.namespace("/users");
  const auth = middleware.authToken();

  subRouter.get("/test", controller.user.test);
  subRouter.post("/login", controller.user.login);
  subRouter.post("/createUser", auth, controller.user.createUser);
  subRouter.post("/getUserList", auth, controller.user.getUserList);
  subRouter.post("/updateUser", auth, controller.user.updateUser);
  subRouter.get("/deleteUser/:id", auth, controller.user.deleteUser);
  subRouter.post(
    "/updateUserPasswordById",
    auth,
    controller.user.updateUserPasswordById
  );
};
